.class public Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;
.super Ljava/lang/Object;
.source "MonotoneChainEdge.java"


# instance fields
.field e:Lcom/vividsolutions/jts/geomgraph/Edge;

.field env1:Lcom/vividsolutions/jts/geom/Envelope;

.field env2:Lcom/vividsolutions/jts/geom/Envelope;

.field pts:[Lcom/vividsolutions/jts/geom/Coordinate;

.field startIndex:[I


# direct methods
.method public constructor <init>(Lcom/vividsolutions/jts/geomgraph/Edge;)V
    .locals 1

    .line 73
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 70
    new-instance v0, Lcom/vividsolutions/jts/geom/Envelope;

    invoke-direct {v0}, Lcom/vividsolutions/jts/geom/Envelope;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->env1:Lcom/vividsolutions/jts/geom/Envelope;

    .line 71
    new-instance v0, Lcom/vividsolutions/jts/geom/Envelope;

    invoke-direct {v0}, Lcom/vividsolutions/jts/geom/Envelope;-><init>()V

    iput-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->env2:Lcom/vividsolutions/jts/geom/Envelope;

    .line 74
    iput-object p1, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->e:Lcom/vividsolutions/jts/geomgraph/Edge;

    .line 75
    invoke-virtual {p1}, Lcom/vividsolutions/jts/geomgraph/Edge;->getCoordinates()[Lcom/vividsolutions/jts/geom/Coordinate;

    move-result-object p1

    iput-object p1, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    .line 76
    new-instance p1, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainIndexer;

    invoke-direct {p1}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainIndexer;-><init>()V

    .line 77
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    invoke-virtual {p1, v0}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainIndexer;->getChainStartIndices([Lcom/vividsolutions/jts/geom/Coordinate;)[I

    move-result-object p1

    iput-object p1, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->startIndex:[I

    return-void
.end method

.method private computeIntersectsForChain(IILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;IILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V
    .locals 9

    .line 124
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object v1, v0, p1

    .line 125
    aget-object v0, v0, p2

    .line 126
    iget-object v2, p3, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    aget-object v3, v2, p4

    .line 127
    aget-object v2, v2, p5

    sub-int v4, p2, p1

    const/4 v5, 0x1

    if-ne v4, v5, :cond_0

    sub-int v4, p5, p4

    if-ne v4, v5, :cond_0

    .line 131
    iget-object p2, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->e:Lcom/vividsolutions/jts/geomgraph/Edge;

    iget-object p3, p3, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->e:Lcom/vividsolutions/jts/geomgraph/Edge;

    invoke-virtual {p6, p2, p1, p3, p4}, Lcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;->addIntersections(Lcom/vividsolutions/jts/geomgraph/Edge;ILcom/vividsolutions/jts/geomgraph/Edge;I)V

    return-void

    .line 135
    :cond_0
    iget-object v4, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->env1:Lcom/vividsolutions/jts/geom/Envelope;

    invoke-virtual {v4, v1, v0}, Lcom/vividsolutions/jts/geom/Envelope;->init(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 136
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->env2:Lcom/vividsolutions/jts/geom/Envelope;

    invoke-virtual {v0, v3, v2}, Lcom/vividsolutions/jts/geom/Envelope;->init(Lcom/vividsolutions/jts/geom/Coordinate;Lcom/vividsolutions/jts/geom/Coordinate;)V

    .line 137
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->env1:Lcom/vividsolutions/jts/geom/Envelope;

    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->env2:Lcom/vividsolutions/jts/geom/Envelope;

    invoke-virtual {v0, v1}, Lcom/vividsolutions/jts/geom/Envelope;->intersects(Lcom/vividsolutions/jts/geom/Envelope;)Z

    move-result v0

    if-nez v0, :cond_1

    return-void

    :cond_1
    add-int v0, p1, p2

    .line 140
    div-int/lit8 v0, v0, 0x2

    add-int v1, p4, p5

    .line 141
    div-int/lit8 v8, v1, 0x2

    if-ge p1, v0, :cond_3

    if-ge p4, v8, :cond_2

    move-object v1, p0

    move v2, p1

    move v3, v0

    move-object v4, p3

    move v5, p4

    move v6, v8

    move-object v7, p6

    .line 146
    invoke-direct/range {v1 .. v7}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->computeIntersectsForChain(IILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;IILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V

    :cond_2
    if-ge v8, p5, :cond_3

    move-object v1, p0

    move v2, p1

    move v3, v0

    move-object v4, p3

    move v5, v8

    move v6, p5

    move-object v7, p6

    .line 147
    invoke-direct/range {v1 .. v7}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->computeIntersectsForChain(IILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;IILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V

    :cond_3
    if-ge v0, p2, :cond_5

    if-ge p4, v8, :cond_4

    move-object v1, p0

    move v2, v0

    move v3, p2

    move-object v4, p3

    move v5, p4

    move v6, v8

    move-object v7, p6

    .line 150
    invoke-direct/range {v1 .. v7}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->computeIntersectsForChain(IILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;IILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V

    :cond_4
    if-ge v8, p5, :cond_5

    move-object v1, p0

    move v2, v0

    move v3, p2

    move-object v4, p3

    move v5, v8

    move v6, p5

    move-object v7, p6

    .line 151
    invoke-direct/range {v1 .. v7}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->computeIntersectsForChain(IILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;IILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V

    :cond_5
    return-void
.end method


# virtual methods
.method public computeIntersectsForChain(ILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;ILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V
    .locals 8

    .line 112
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->startIndex:[I

    aget v2, v0, p1

    add-int/lit8 p1, p1, 0x1

    aget v3, v0, p1

    iget-object p1, p2, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->startIndex:[I

    aget v5, p1, p3

    add-int/lit8 p3, p3, 0x1

    aget v6, p1, p3

    move-object v1, p0

    move-object v4, p2

    move-object v7, p4

    invoke-direct/range {v1 .. v7}, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->computeIntersectsForChain(IILcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;IILcom/vividsolutions/jts/geomgraph/index/SegmentIntersector;)V

    return-void
.end method

.method public getMaxX(I)D
    .locals 4

    .line 91
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->startIndex:[I

    aget v2, v1, p1

    aget-object v2, v0, v2

    iget-wide v2, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-int/lit8 p1, p1, 0x1

    .line 92
    aget p1, v1, p1

    aget-object p1, v0, p1

    iget-wide v0, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpl-double p1, v2, v0

    if-lez p1, :cond_0

    move-wide v0, v2

    :cond_0
    return-wide v0
.end method

.method public getMinX(I)D
    .locals 4

    .line 85
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->pts:[Lcom/vividsolutions/jts/geom/Coordinate;

    iget-object v1, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->startIndex:[I

    aget v2, v1, p1

    aget-object v2, v0, v2

    iget-wide v2, v2, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    add-int/lit8 p1, p1, 0x1

    .line 86
    aget p1, v1, p1

    aget-object p1, v0, p1

    iget-wide v0, p1, Lcom/vividsolutions/jts/geom/Coordinate;->x:D

    cmpg-double p1, v2, v0

    if-gez p1, :cond_0

    move-wide v0, v2

    :cond_0
    return-wide v0
.end method

.method public getStartIndexes()[I
    .locals 1

    .line 81
    iget-object v0, p0, Lcom/vividsolutions/jts/geomgraph/index/MonotoneChainEdge;->startIndex:[I

    return-object v0
.end method
